import React, { lazy, Suspense } from 'react';
import Loading from '../components/Loading'
import { Route, Switch, Redirect } from 'react-router-dom'
/* 引入需要懒加载的组件 */
const Login = lazy(() => import('../views/login/Index'))
const Dashboard = lazy(() => import('../views/Dashboard'))
const Basicrouter = () => {
    return (
        <Suspense fallback={<Loading />}>
            <Switch>
                <Redirect from='/' to='/login' exact />
                <Route path='/login' component={Login}></Route>
                <Route path='/dashboard' component={Dashboard}></Route>
            </Switch>
        </Suspense>
    );
}

export default Basicrouter;
